package net.huashitong.oversee.service;

import com.sirdc.modules.core.dao.BaseDao;
import com.sirdc.modules.sys.base.StringPKService;
import com.sirdc.modules.sys.service.SysTableService;
import net.huashitong.oversee.dao.TackTaskLogDao;
import net.huashitong.oversee.entity.TackTaskLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TackTaskLogService extends StringPKService<TackTaskLog> {

    @Autowired
    private TackTaskLogDao dao;
    @Autowired
    private SysTableService tableService;

    @Override
    protected BaseDao<TackTaskLog, String> getDao() {
        return dao;
    }
    @Override
    protected void beforeSave(TackTaskLog obj) {
        obj.setSysId(tableService.updateMaxSysId("t_tack_task_log", null));
    }

    public List<TackTaskLog> queryTackLogByTaskId(String taskId){
        return dao.queryTackLogByTaskId(taskId);
    }
}
